clear all 
clc
for k=1:1:20
    n=fun1(k);
    f=max1(n,k);
    K(k)=k;
    F(k)=f;
end
plot(K,F);
xlabel('K');
ylabel('F');

j=2;
for i=1:19
    if F(j)>=F(i)
        maxK=j;
        maxF=F(j);
        j=j+1;
    else
        j=j-1;
       break
    end
end
maxK
